﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script type="text/javascript" src="../Content/highlighter/scripts/shCore.js"></script>
    <script type="text/javascript" src="../Content/highlighter/scripts/shBrushCSharp.js"></script>
    <script type="text/javascript" src="../Content/highlighter/scripts/shBrushXml.js"></script>
    <link type="text/css" rel="stylesheet" href="../Content/highlighter/styles/shCoreDefault.css" />
    <script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
    <h3>.net mvc新模板下如何添加中间件？</h3>
    <b>1.安装Microsoft.Owin.Host.SystemWeb nuget包 3.1.0 版</b><br />
    <p>
        Install-Package Microsoft.Owin.Host.SystemWeb -Version 3.1.0
    </p>
    <b>2.添加Owin中间件</b>
    <pre class="brush:csharp;">
        using System;
        using System.Threading.Tasks;
        using Microsoft.Owin;
        using Owin;

        //若该类名为Startup则不需要写该程序集特性
        [assembly: OwinStartup(typeof(WebApplication1.Startup))]

        namespace WebApplication1
        {
            public class Startup
            {
                public void Configuration(IAppBuilder app)
                {
                    // 有关如何配置应用程序的详细信息，请访问 https://go.microsoft.com/fwlink/?LinkID=316888
                }
            }
        }

    </pre>
</body>
</html>